import NavHeader from '@/components/MUJIHeader/NavHeader'
import ItemHeader from '@/components/MUJIHeader/ItemHeader'
const Home = () => import('@/views/Home')
const Search = () => import('@/views/Search')
const Classify = () => import('@/views/Classify')
const News = () => import('@/views/News')
const Cart = () => import('@/views/Cart')

export default [
  {
    path: '/',
    redirect: '/home',
    meta: {
      isTabbar: false
    }
  },
  {
    path: '/home',
    name: 'home',
    components: {
      default: Home,
      mujiHeader: NavHeader
    },
    meta: {
      isTabbar: false
    }
  },
  {
    path: '/search',
    name: 'search',
    components: {
      default: Search,
      mujiHeader: ItemHeader
    },
    meta: {
      isTabbar: true,
      title: '',
      eventEl: '<input type="text" placeholder="搜索商品">',
      icon: '&#xe606;'
    }
  },
  {
    path: '/classify',
    name: 'classify',
    components: {
      default: Classify,
      mujiHeader: ItemHeader
    },
    meta: {
      isTabbar: true,
      title: '分类',
      eventEl: '<router-link to="/cart">&#xe616</router-link>',
      icon: '&#xe617;'
    }
  },
  {
    path: '/news',
    name: 'news',
    components: {
      default: News,
      mujiHeader: ItemHeader
    },
    meta: {
      isTabbar: true,
      title: '消息通知',
      eventEl: '',
      icon: '&#xe620;'
    }
  },
  {
    path: '/cart',
    name: 'cart',
    components: {
      default: Cart,
      mujiHeader: ItemHeader
    },
    meta: {
      isTabbar: true,
      title: '购物车',
      eventEl: '<span v-if="isRender" @click="redactCard">编辑</span><span v-else @click="finishCard"></span>',
      icon: '&#xe616;'
    }
  }
]
